Remove empty horizon component from irradiance.haydavies#2788
Conversation
|
@kandersolar This is technically a breaking change. Do we want a deprecation period (which will slow down the GSoC project a lot - probably not a good reason not to do it)? |
I'd love one, but unfortunately we don't have a good mechanism for deprecating dict/dataframe keys (see #2530). If we go forward with this change, I think all we can do is just do it. Not related, but fyi: I need to review the discussion about not including empty components, since it's a change in direction and I don't remember the arguments for/against. |
There is some discussion about including / not including empty components in #2750 and #2527. As far as I'm aware: Pros of including:
Pros of not including:
|
|
I think the low level transposition functions should return only what is relevant to that model and nothing more. The wrapper functions and object layers smooth over the differences for users that want a completely consistent API. |
Closes #xxxxTests addedUpdates entries indocs/sphinx/source/referencefor API changes.docs/sphinx/source/whatsnewfor all changes. Includes link to the GitHub Issue with:issue:`num`or this Pull Request with:pull:`num`. Includes contributor name and/or GitHub username (link with:ghuser:`user`).remote-data) and Milestone are assigned to the Pull Request and linked Issue.This PR is part of my GSoC 2026 project. One of the goals is to add support for
return_componentsto all diffuse transposition models inpvlib, which currently is supported by some models (e.g.perez) but not others. This parameter allows the user to choose whether they want only the total diffuse irradiance (default), or are interested in the split between different diffuse components (sky diffuse, circumsolar, horizon brightening).haydaviesis one of the models which already supportsreturn_components. However, the model itself supports only sky diffuse and circumsolar components, not horizon brightening. Currently, the function returns a horizon brightening component filled with zeros. As suggested by @adriesse here, I've decided not to include empty components in new additions and so, for consistency, I've also modifiedhaydaviesto remove the horizon brightening component.In addition, I've changed the existing
OrderedDictto adict, as suggested by @kandersolar (see #1684).The docstrings and the relevant test were also modified accordingly.